package com.atguigu.eduservice.client;

import com.atguigu.commonutils.R;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther: fangshicai
 * @Date: 2022/2/28 16:39
 * @Description:
 */

@Component
//fallback = VodFileDegradeFeignClient.class 服务熔断 hystrix
//服务调用的调用端调用注册名为service-vod
@FeignClient(name="service-vod",fallback = VodFileDegradeFeignClient.class)
public interface VodClient {

    //视频删除接口
    //直接复制service-vod删除接口 并且只写接口不写实现类
    //特别注意的是 @PathVariable要有name
    //并且加完整的路径
    @DeleteMapping("/eduvod/video/deleteAliyunVideo/{id}")
    public R deleteAliyunVideo(@PathVariable(name = "id") String id);

    //根据传入的id集合删除阿里云的上传视频
    @DeleteMapping("/eduvod/video/deleteAliyunVideo-batch")
    public R deleteAliyunVideoBatch(@RequestParam List<String> videoAliyunSourseIdsList);
}
